let cashfilter = value =>{
    return parseFloat(value / 100).toFixed(2);
}
let feeTemplate = value =>{
     if (value.amount == null) {
        if (value.top) {
          return (
            parseFloat(value.rate).toFixed(4) +
            "%" +
            ",封顶" +
            value.top +
            "元"
          );
        } else {
          return parseFloat(value.rate).toFixed(4) + "%";
        }
      } else {
        if(value.rate || value.rate == 0){
          return (
            parseFloat(value.rate).toFixed(4) +
            "% ," +
            value.amount / 100 +
            "元/笔"
          );
        } else if (value.top) {
          return (
            value.amount + "元/笔" + ",封顶" + value.top + "元"
          );
        } else {
          return value.amount + "元/笔";
        }
      }
}
let accountfilter = value => {
      return (value / 1000000).toFixed(2);
}

let AccountNofilter =(value) =>{
  if (value) {
      // var reg1 = value.slice(0,6)
      var reg2 = value.slice(-4)
      return  "***************" + reg2;
  }
}
export default{
  cashfilter,
  feeTemplate,
  accountfilter,
  AccountNofilter
}
